<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<meta name="viewport" content="width=1000, initial-scale=1.0, maximum-scale=1.0">
	    <!-- Loading Bootstrap -->
	    <link href="./Public/Admin/Flat/dist/css/vendor/bootstrap.min.css" rel="stylesheet">
	    <!-- Loading Flat UI -->
	    <link href="./Public/Admin/Flat/dist/css/flat-ui.css" rel="stylesheet">
	    <link href="./Public/Admin/Flat/docs/assets/css/demo.css" rel="stylesheet">
	    <link rel="shortcut icon" href="./Public/Admin/Flat/img/favicon.ico">
	    <!-- HTML5 shim, for IE6-8 support of HTML5 elements. All other JS at the end of file. -->
	    <!--[if lt IE 9]>
	      <script src="dist/js/vendor/html5shiv.js"></script>
	      <script src="dist/js/vendor/respond.min.js"></script>
	    <![endif]-->
	    <!--<script src="View/jquery-1.8.2.min.js" type="text/javascript" charset="utf-8"></script>-->
		<!--<script type="text/javascript">
			$(function(){
				alert();
				//表单提交事件
				$('#form').submit(function(){
					//一次可以抓取到整个表单的所有内容
					var data = $(this).serialize();
					$.ajax({
						type:"post",
						url:"index.php?a=add",
						data:data,
						//指定服务器返回的数据类型
						dataType:'json',
						success:function(phpData){
							//phpData相当于{title:'标题',content:'内容'}
							var html = "<tr>";
							html += "<td>"+phpData.id+"</td>";
							html += "<td>"+phpData.title+"</td>";
							html += "<td>"+phpData.content+"</td>";
							html += "<td><a href='' class='btn btn-info btn-sm'>编辑</a> <a href='' class='btn btn-danger btn-sm'>删除</a></td></tr>";
							$('table').append(html);
							//清掉已有内容
							$('form')[0].reset();
						}
					});
				})
			})
		</script>-->
	</head>
	<body>
		<table class="table table-hover">
			<tr class="active">
			  <th width="100">货品id</th>
			  <?php foreach ($data as $v){?>
			  <th width="150"><?php echo $v['aname']?></th>
        	  <?php }?>
			  <th width="180">库存</th>
			  <th width="180">货号</th>
			  <th width="200">操作</th>
			</tr>
			
	            
			<?php foreach ($listData as $v){?>
        	<tr width="100">
	            <td><?php echo $v['slid']?></td>
	            <?php foreach ($v['value'] as $k=>$value){?>
	                <td><?php echo $value['shop_attributecol']?></td>
	            <?php }?>
	            <td><?php echo $v['inventory']?></td>
	            <td><?php echo $v['number']?></td>
	            <td>
	            	
				
	          	<!--<?php echo $num=count($v['value'])?>-->
	                <a href="index.php?m=Admin&c=Shop_list&a=edit&slid=<?php echo $v['slid']?>&name=<?php foreach($v['value'] as $k=>$d){echo($v['value'][$k]['shop_attributecol']); ?><?php }?>&sid=<?php echo Q('get.sid')?>">编辑</a>
	                <!--<a href="<?php echo U('edit',array('slid'=>$v['slid'],'sid'=>Q('get.sid')))?>">编辑</a>-->

	                <a href="javascript:if(confirm('确定删除吗？')) location.href='<?php echo U('del',array('slid'=>$v['slid']))?>'">删除</a>
	            </td>
        	</tr>
    <?php }?>
    <form action="" method="post" >
    <tr class="active">
        <td width="180">添加货品</td>
        <?php foreach ($data as $v){?>
            <td>
                <select name="combine[]" id="">
                    <option value="">请选择</option>
                    <?php foreach ($v['value'] as $value){?>
                        <option value="<?php echo $value['shop_attributecol']?>"><?php echo $value['shop_attributecol']?></option>
                    <?php }?>
                </select>
            </td>
        <?php }?>
        <td>
            <input style="width: 100px;" type="text" name="inventory" id="" placeholder="请输入库存">
        </td>
        <td>
            <input style="width: 100px;" type="text" name="number" id="" placeholder="请输入货号">
        </td>
        <td>
        	<!--<input type="button" name="" id="" value="添加" />
            <a href="<?php echo U('add',array('sid'=>$_GET['sid']))?>">添加</a>-->
            <input type="hidden" name="sid" value="<?php echo $_GET['sid']?>" />
			<button  type="submit" style="display: inline-block"> 确定</button>
        </td>
    </tr>
    </form>
		</table>
		<!--<style type="text/css">
			#self-page ul.pagination li{
				background: #ccc;
				margin-left: 3px;
			}
		</style>
		<center id="self-page">
			<ul class="pagination">
				<?php echo $page?>
			</ul>
		</center>-->
	</body>
</html>
